package chapter2.No2_2_synchronized同步语句块.g将任意对象作为对象监视器.demo3;

/**
 * *：验证同步方法可能会造成的“脏读”
 * Created by Administrator on 2016/11/12.
 */
public class Main {

    public static void main(String[] args) throws InterruptedException {
        ServiceClass sc = new ServiceClass();
        MyThread a = new MyThread(sc);
        MyThread b = new MyThread(sc);

        a.start();
        b.start();

        Thread.sleep(4000);
        System.out.println(sc.getSize());

    }
}
